| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | /*! |
||
| 15 | module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) { |
||
| 16 | var destDir = path.dirname(destFilepath); |
||
| 17 | |||
| 18 | function srcPathToDestRequire(srcFilepath) { |
||
| 19 | var requirePath = path.relative(destDir, srcFilepath).replace(/\\/g, '/'); |
||
| 20 | return 'require(\'' + requirePath + '\')'; |
||
| 21 | } |
||
| 22 | |||
| 23 | var moduleOutputJs = COMMONJS_BANNER + srcFiles.map(srcPathToDestRequire).join('\n'); |
||
| 24 | try { |
||
| 25 | fs.writeFileSync(destFilepath, moduleOutputJs); |
||
| 26 | } catch (err) { |
||
| 27 | grunt.fail.warn(err); |
||
| 28 | } |
||
| 29 | grunt.log.writeln('File ' + destFilepath.cyan + ' created.'); |
||
| 30 | }; |
||
| 31 |